package com.youpai.platform.vulture.web.api;

import com.youpai.platform.common.entity.resp.BaseResponse;
import com.youpai.platform.vulture.service.service.VultureConfigService;
import com.youpai.platform.vulture.web.entity.req.GetVultureHandshakeTokenReq;
import com.youpai.platform.vulture.web.entity.resp.GetVultureHandshakeTokenResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: VultureConfig web
 * @Author:welles
 * @Date:2022/7/23
 */
@Slf4j
@RestController
@RequestMapping(value = "/vulture")
@Api(value = "VultureConfigController", tags = "Vulture配置相关")
public class VultureConfigController {

    @Resource
    private VultureConfigService vultureConfigService;

    @ApiOperation(value = "获取Vulture握手token")
    @PostMapping(value = "/handshake/token")
    public BaseResponse<GetVultureHandshakeTokenResp> getVultureHandshakeToken(@RequestBody GetVultureHandshakeTokenReq req) {
        return BaseResponse.success(vultureConfigService.getVultureHandshakeToken(req));
    }
}
